<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>module Fcntl - fcntl: Ruby Standard Library Documentation</title>


<script src="./js/navigation.js" defer></script>
<script src="./js/search.js" defer></script>
<script src="./js/search_index.js" defer></script>
<script src="./js/searcher.js" defer></script>
<script src="./js/darkfish.js" defer></script>

<script src="./js/jquery-3.2.0.min.js"></script>

<script src="./js/vue.min.js"></script>
<script src="./js/js.cookie.min.js"></script>

<link href="./css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="./css/rdoc.css" rel="stylesheet">
<link href="./css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "./";
  var index_rel_prefix = "./";
  var darkModeCsseHref = "./css/rdoc-dm.css"
  var defaultModeCssHref = "./css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="module">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="./index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="./table_of_contents.html#pages">Pages</a>
    <a href="./table_of_contents.html#classes">Classes</a>
    <a href="./table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
        
        
        
      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="module-Fcntl">
    <h1 id="module-Fcntl" class="module">
      module Fcntl
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="FD_CLOEXEC">FD_CLOEXEC
          <dd><p><a href="Fcntl.html#FD_CLOEXEC"><code>FD_CLOEXEC</code></a></p>

<p>the value of the close-on-exec flag.</p>
          <dt id="F_DUP2FD">F_DUP2FD
          <dd><p><a href="Fcntl.html#F_DUP2FD"><code>F_DUP2FD</code></a></p>

<p>It is a FreeBSD specific constant and equivalent to dup2 call.</p>
          <dt id="F_DUP2FD_CLOEXEC">F_DUP2FD_CLOEXEC
          <dd><p><a href="Fcntl.html#F_DUP2FD_CLOEXEC"><code>F_DUP2FD_CLOEXEC</code></a></p>

<p>It is a FreeBSD specific constant and acts similarly as <a href="Fcntl.html#F_DUP2FD"><code>F_DUP2FD</code></a> but set the <a href="Fcntl.html#FD_CLOEXEC"><code>FD_CLOEXEC</code></a> flag in addition.</p>
          <dt id="F_DUPFD">F_DUPFD
          <dd><p><a href="Fcntl.html#F_DUPFD"><code>F_DUPFD</code></a></p>

<p>Duplicate a file descriptor to the minimum unused file descriptor greater than or equal to the argument.</p>

<p>The close-on-exec flag of the duplicated file descriptor is set. (Ruby uses F_DUPFD_CLOEXEC internally if available to avoid race condition.  <a href="Fcntl.html#F_SETFD"><code>F_SETFD</code></a> is used if F_DUPFD_CLOEXEC is not available.)</p>
          <dt id="F_GETFD">F_GETFD
          <dd><p><a href="Fcntl.html#F_GETFD"><code>F_GETFD</code></a></p>

<p>Read the close-on-exec flag of a file descriptor.</p>
          <dt id="F_GETFL">F_GETFL
          <dd><p><a href="Fcntl.html#F_GETFL"><code>F_GETFL</code></a></p>

<p>Get the file descriptor flags.  This will be one or more of the O_* flags.</p>
          <dt id="F_GETLK">F_GETLK
          <dd><p><a href="Fcntl.html#F_GETLK"><code>F_GETLK</code></a></p>

<p>Determine whether a given region of a file is locked.  This uses one of the F_*LK flags.</p>
          <dt id="F_GETPIPE_SZ">F_GETPIPE_SZ
          <dd><p><a href="Fcntl.html#F_GETPIPE_SZ"><code>F_GETPIPE_SZ</code></a></p>

<p>Return (as the function result) the capacity of the pipe referred to by fd.</p>
          <dt id="F_RDLCK">F_RDLCK
          <dd><p><a href="Fcntl.html#F_RDLCK"><code>F_RDLCK</code></a></p>

<p>Read lock for a region of a file</p>
          <dt id="F_SETFD">F_SETFD
          <dd><p><a href="Fcntl.html#F_SETFD"><code>F_SETFD</code></a></p>

<p>Set the close-on-exec flag of a file descriptor.</p>
          <dt id="F_SETFL">F_SETFL
          <dd><p><a href="Fcntl.html#F_SETFL"><code>F_SETFL</code></a></p>

<p>Set the file descriptor flags.  This will be one or more of the O_* flags.</p>
          <dt id="F_SETLK">F_SETLK
          <dd><p><a href="Fcntl.html#F_SETLK"><code>F_SETLK</code></a></p>

<p>Acquire a lock on a region of a file.  This uses one of the F_*LCK flags.</p>
          <dt id="F_SETLKW">F_SETLKW
          <dd><p><a href="Fcntl.html#F_SETLKW"><code>F_SETLKW</code></a></p>

<p>Acquire a lock on a region of a file, waiting if necessary.  This uses one of the F_*LCK flags</p>
          <dt id="F_SETPIPE_SZ">F_SETPIPE_SZ
          <dd><p><a href="Fcntl.html#F_SETPIPE_SZ"><code>F_SETPIPE_SZ</code></a></p>

<p>Change the capacity of the pipe referred to by fd to be at least arg bytes.</p>
          <dt id="F_UNLCK">F_UNLCK
          <dd><p><a href="Fcntl.html#F_UNLCK"><code>F_UNLCK</code></a></p>

<p>Remove lock for a region of a file</p>
          <dt id="F_WRLCK">F_WRLCK
          <dd><p><a href="Fcntl.html#F_WRLCK"><code>F_WRLCK</code></a></p>

<p>Write lock for a region of a file</p>
          <dt id="O_ACCMODE">O_ACCMODE
          <dd><p><a href="Fcntl.html#O_ACCMODE"><code>O_ACCMODE</code></a></p>

<p>Mask to extract the read/write flags</p>
          <dt id="O_APPEND">O_APPEND
          <dd><p><a href="Fcntl.html#O_APPEND"><code>O_APPEND</code></a></p>

<p>Open the file in append mode</p>
          <dt id="O_CREAT">O_CREAT
          <dd><p><a href="Fcntl.html#O_CREAT"><code>O_CREAT</code></a></p>

<p>Create the file if it doesn’t exist</p>
          <dt id="O_EXCL">O_EXCL
          <dd><p><a href="Fcntl.html#O_EXCL"><code>O_EXCL</code></a></p>

<p>Used with <a href="Fcntl.html#O_CREAT"><code>O_CREAT</code></a>, fail if the file exists</p>
          <dt id="O_NDELAY">O_NDELAY
          <dd><p><a href="Fcntl.html#O_NDELAY"><code>O_NDELAY</code></a></p>

<p>Open the file in non-blocking mode</p>
          <dt id="O_NOCTTY">O_NOCTTY
          <dd><p><a href="Fcntl.html#O_NOCTTY"><code>O_NOCTTY</code></a></p>

<p>Open TTY without it becoming the controlling TTY</p>
          <dt id="O_NONBLOCK">O_NONBLOCK
          <dd><p><a href="Fcntl.html#O_NONBLOCK"><code>O_NONBLOCK</code></a></p>

<p>Open the file in non-blocking mode</p>
          <dt id="O_RDONLY">O_RDONLY
          <dd><p><a href="Fcntl.html#O_RDONLY"><code>O_RDONLY</code></a></p>

<p>Open the file in read-only mode</p>
          <dt id="O_RDWR">O_RDWR
          <dd><p><a href="Fcntl.html#O_RDWR"><code>O_RDWR</code></a></p>

<p>Open the file in read-write mode</p>
          <dt id="O_TRUNC">O_TRUNC
          <dd><p><a href="Fcntl.html#O_TRUNC"><code>O_TRUNC</code></a></p>

<p>Truncate the file on open</p>
          <dt id="O_WRONLY">O_WRONLY
          <dd><p><a href="Fcntl.html#O_WRONLY"><code>O_WRONLY</code></a></p>

<p>Open the file in write-only mode.</p>
          <dt id="VERSION">VERSION
          <dd>
        </dl>
        </section>



              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

